package com.metadata_system.common.enums;

import java.util.HashMap;
import java.util.Map;

// 手机验证码-事件类型
public enum MobileVerifyEventType {
    login,
    loginAndBindingByThirdUser,
    register,
    resetPassword,
    changeMobileNew,
    changeMobileOld;


    private final static Map<String , MobileVerifyEventType> ENUM_MAP = new HashMap<String, MobileVerifyEventType>(64);

    static {
        for(MobileVerifyEventType v : values()) {
            ENUM_MAP.put(v.toString() , v);
        }
    }

    public static MobileVerifyEventType fromString(String v) {
        MobileVerifyEventType userOptionEnum = ENUM_MAP.get(v);
        return userOptionEnum == null ? login :userOptionEnum;
    }
}
